<?php
namespace app\index\validate;

use think\Validate;

class MemberAddress extends Validate
{
    protected $rule = [
//        ['member_id', 'require'],
        ['name', 'require'],
        ['phone', 'require|regex:^1[34578]{1}\d{9}$'],
        ['address', 'require'],
        ['status', 'require'],

    ];

    protected $message = [
//        'member_id.require' => '您还未登录',
        'name.require'    => '请填写收货人',
        'phone.require'   => '请填写收货人手机号',
        'phone.regex'     => '请填写正确手机号',
        'address.require' => '请填写详细收货地址',
        'status.require'  => '请选择默认地址',
    ];

    protected $scene = [
        'create' => ['user_id', 'name', 'phone', 'area_id', 'address', 'status'],
    ];
}